import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;

import javax.swing.JLabel;
import javax.swing.JPanel;

public class GUI_navi extends JPanel {
	private String mode = "surrounding";
	
	public GUI_navi() {
		
		setLayout(null);
		
		// MAP INIT
		//
		MapController mc = new MapController();
		mc.init(Main.Navi.getMapInfo());
		
		add(mc.setMap(0, 0, 800, 420));

		GUI_navibar NaviBar = new GUI_navibar();
		NaviBar.setBounds(0, 420, 800, 80);
		add(NaviBar);
	}	
	
	public GUI_navi(String __mode) {
		this.mode = __mode;
		
		setLayout(null);
		
		// MAP INIT
		//
		MapController mc = new MapController();
		mc.setMode(mode);
		mc.init(Main.Navi.getMapInfo());
		
		add(mc.setMap(0, 0, 800, 420));

		GUI_navibar NaviBar = new GUI_navibar();
		NaviBar.setBounds(0, 420, 800, 80);
		add(NaviBar);
	}
	
	public GUI_navi(String __mode, int filtering_id) {
		this.mode = __mode;
		
		setLayout(null);
		
		// MAP INIT
		//
		MapController mc = new MapController();
		mc.setMode(mode);
		mc.setFilteringId(filtering_id);
		mc.init(Main.Navi.getMapInfo());
		
		add(mc.setMap(0, 0, 800, 420));

		GUI_navibar NaviBar = new GUI_navibar();
		NaviBar.setBounds(0, 420, 800, 80);
		add(NaviBar);
	}
}

class GUI_navibar extends JPanel implements ActionListener {
	Image img = null;

	public GUI_navibar() {
		Toolkit kit = Toolkit.getDefaultToolkit();
		img = kit.getImage("images/bar.jpg");

		setLayout(null);
		
		//������ ���移� 媛깆��
		Main.Navi.ReLoc();
		///////////
		JLabel lb = new JLabel("현재 위치: "+"수정로");
		lb.setBounds(30, 10, 500, 20);
		lb.setForeground(Color.white);
		lb.setFont(new Font("bold", Font.BOLD, 15));
		add(lb);

		// �����ъ��移� 異����

		Image btimg_menu[] = new Image[4];
		btimg_menu[0] = kit.getImage("images/bt_menu.jpg");
		btimg_menu[1] = kit.getImage("images/bt_menu.jpg");
		btimg_menu[2] = kit.getImage("images/bt_menu.jpg");
		btimg_menu[3] = kit.getImage("images/bt_menu.jpg");

		ImageButton bt_menu = new ImageButton(btimg_menu);
		bt_menu.setBounds(700, 0, 70, 100);
		bt_menu.addActionListener(this);
		add(bt_menu);

	}

	protected void paintComponent(Graphics g) {
		g.drawImage(img, 0, 0, 800, 100, this);
	}

	public void actionPerformed(ActionEvent ae) {
		Main.Navi.con.removeAll();

		GUI_menu Menu = new GUI_menu();
		Menu.setBounds(0, 0, 800, 500);
		Main.Navi.con.add(Menu);

		Main.Navi.con.validate();
	}
}

// 吏����(��⑥��������)
class GUI_map extends JPanel {
	public GUI_map() {
		setBackground(Color.white);
	}
}
